﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Xml.Linq;
using A2DFramework.EventService.Configuration;
using A2DFramework.QueueService;
using A2DFramework.InstanceService;

namespace A2DFramework.EventService.Providers
{
    public class LocalEventBusProvider : IEventBusProvider
    {
        private IQueue queueSrv = ObjectFactory.Resolve<IQueue>();

        public void Publish(IEvent evt)
        {
            EventInfo info = new EventInfo();
            info.ClassType = evt.GetType().FullName;
            info.Xml = XmlHelper.Serialize(evt.GetType(), evt);
            queueSrv.SendRequest2Worker<EventInfo>(info);
        }

        public void Subscribe(string evtClassType)
        {
        }
    }
}
